package com.controller;

import com.base.BasePageReq;
import com.base.BasePageRes;
import com.req.VipVoucherReq;
import com.res.VipVoucherRes;
import com.service.VipVoucherService;
import com.util.common.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/vip/voucher")
@RestController
@Api(tags = "消费卷")
public class VipVoucherController {
    @Autowired
    private VipVoucherService vipVoucherService;
    @PostMapping("/save")
    @ApiOperation("消费卷")
    public R<VipVoucherRes> saveVipUser(@RequestBody VipVoucherReq req){

        return R.ok(vipVoucherService.saveVipUser(req));
    }
    @PostMapping("/queryPage")
    @ApiOperation("消费卷分页查询")
    public R<BasePageRes> queryPage(@RequestBody BasePageReq req){
        return R.ok(vipVoucherService.queryPage(req));
    }

}
